From 77b0f69d0c6e555349dd491d7ca209924d119e61 Mon Sep 17 00:00:00 2001 From: Matt Kosarek Date: Wed, 11 Mar 2026 17:49:05 -0400 Subject: Migrate to astro --- src/pages/posts/[slug].astro | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/pages/posts/[slug].astro (limited to 'src/pages/posts/[slug].astro') diff --git a/src/pages/posts/[slug].astro b/src/pages/posts/[slug].astro new file mode 100644 index 0000000..0f29ec5 --- /dev/null +++ b/src/pages/posts/[slug].astro @@ -0,0 +1,19 @@ +--- +import { getCollection, type CollectionEntry } from 'astro:content'; +import PostLayout from '../../layouts/PostLayout.astro'; + +export async function getStaticPaths() { + const posts = await getCollection('posts'); + return posts.map((post: CollectionEntry<'posts'>) => ({ + params: { slug: post.slug }, + props: { post }, + })); +} + +const { post } = Astro.props as { post: CollectionEntry<'posts'> }; +const { Content } = await post.render(); +--- + + + + -- cgit v1.2.1